import request from '@/config/axios'

export interface ProjectVO {
  id: number
  name: string
  businessType: string
  projectLevel: string
  serverTime: number
  originalPrice: number
  discountPrice: number
  imageUrl: string
  tags: string
}

// 查询项目分页
export const getProjectPage = async (params) => {
  return await request.get({ url: `/meijia/project/page`, params })
}

// 查询项目详情
export const getProject = async (id: number) => {
  return await request.get({ url: `/meijia/project/get?id=` + id })
}

// 新增项目
export const createProject = async (data: ProjectVO) => {
  return await request.post({ url: `/meijia/project/create`, data })
}

// 修改项目
export const updateProject = async (data: ProjectVO) => {
  return await request.put({ url: `/meijia/project/update`, data })
}

// 删除项目
export const deleteProject = async (id: number) => {
  return await request.delete({ url: `/meijia/project/delete?id=` + id })
}

// 导出项目 Excel
export const exportProject = async (params) => {
  return await request.download({ url: `/meijia/project/export-excel`, params })
}
// 获得到店项目
export const getStoreProject = async () => {
  return await request.get({ url: `/meijia/project/get-store-project` })
}
// 获得到家项目
export const getHomeProject = async () => {
  return await request.get({ url: `/meijia/project/get-home-project` })
}